#pragma once
#include <vector>
#include <boost/smart_ptr.hpp>
#include <iostream>

class JNodeData
{
public:
	virtual int Serialize(std::iostream& strea) = 0;
	virtual void ReSerialize(std::iostream& strea) = 0;
};

class JNode
{
public:
	JNode(void);
	~JNode(void);

	int selfIndex;
	int parentIndex;
	std::vector<int> childrenIndex;
	boost::shared_ptr<JNodeData> data;
	//return its' self size.
	int Serialize(std::iostream& strea);
	//return its' self size.
	int ReSerialize(std::iostream& strea);
};

typedef boost::shared_ptr<JNode> JNodePtr;
